#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
#define MAX_LEN 100
using namespace std;

void show()
{
    cout << "********************************" << endl;
    cout << "********************************" << endl;
    cout << "********1.餐饮信管系统**********" << endl;
    cout << "********2.景点信管系统**********" << endl;
    cout << "********3.名族演艺管理系统******" << endl;
    cout << "********4.解说人员管理系统******" << endl;
    cout << "********5.酒店宾馆信管系统******" << endl;
    cout << "********6.车站志愿信管系统******" << endl;
    cout << "********7.安保人员信管系统******" << endl;
    cout << "********8.车辆志愿管理系统******" << endl;
    cout << "********0.退出管理系统**********" << endl;
    cout << "********************************" << endl;
    cout << "********************************" << endl;
}

void show1()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加餐厅信息\n";
    cout << "2. 修改餐厅信息\n";
    cout << "3. 删除餐厅信息\n";
    cout << "4. 餐饮种类统计餐厅\n";
    cout << "5. 保存餐厅信息\n";
    cout << "6. 读取餐厅信息\n";
    cout << "0. 退出\n";
}

void show2()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加景点信息\n";
    cout << "2. 修改景点信息\n";
    cout << "3. 删除景点信息\n";
    cout << "4. 按景点特色统计景点\n";
    cout << "5. 保存景点信息\n";
    cout << "6. 读取景点信息\n";
    cout << "0. 退出\n";
}

void show3()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加名族演艺信息\n";
    cout << "2. 修改名族演艺信息\n";
    cout << "3. 删除名族演艺信息\n";
    cout << "4. 按表演特色统计名族演艺\n";
    cout << "5. 保存名族演艺信息\n";
    cout << "6. 读取名族演艺信息\n";
    cout << "0. 退出\n";
}

void show4()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加解说人员信息\n";
    cout << "2. 修改解说人员信息\n";
    cout << "3. 删除解说人员信息\n";
    cout << "4. 按解说人员单位统计解说人员\n";
    cout << "5. 保存解说人员信息\n";
    cout << "6. 读取解说人员信息\n";
    cout << "0. 退出\n";
}

void show5()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加酒店宾馆信息\n";
    cout << "2. 修改酒店宾馆信息\n";
    cout << "3. 删除酒店宾馆信息\n";
    cout << "4. 按特色酒店星级统计酒店宾馆\n";
    cout << "5. 保存酒店宾馆信息\n";
    cout << "6. 读取酒店宾馆信息\n";
    cout << "0. 退出\n";
}

void show6()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加车站志愿信息\n";
    cout << "2. 修改车站志愿信息\n";
    cout << "3. 删除车站志愿信息\n";
    cout << "4. 按车站志愿者单位统计车站志愿\n";
    cout << "5. 保存车站志愿信息\n";
    cout << "6. 读取车站志愿信息\n";
    cout << "0. 退出\n";
}

void show7()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加安保人员信息\n";
    cout << "2. 修改安保人员信息\n";
    cout << "3. 删除安保人员信息\n";
    cout << "4. 按安保人员单位统计安保人员\n";
    cout << "5. 保存安保人员信息\n";
    cout << "6. 读取安保人员信息\n";
    cout << "0. 退出\n";
}

void show8()
{
    cout << "\n管理信息系统菜单:\n";
    cout << "1. 添加车辆志愿信息\n";
    cout << "2. 修改车辆志愿信息\n";
    cout << "3. 删除车辆志愿信息\n";
    cout << "4. 按车辆志愿单位统计车辆志愿\n";
    cout << "5. 保存车辆志愿信息\n";
    cout << "6. 读取车辆志愿信息\n";
    cout << "0. 退出\n";
}

class Restaurant {
private:
    string id;
    string name;
    string opening_time;
    string room_types;
    string address;
    string traffic;
    string food_types;
    string business_hours;
    int has_performance;
    float avg_price;
    string owner;
    string owner_id;
    string notes;

public:
    // 构造函数
    Restaurant(string id, string name, string opening_time, string room_types, string address, string traffic,
        string food_types, string business_hours, int has_performance, float avg_price,
        string owner, string owner_id, string notes)
        : id(id), name(name), opening_time(opening_time), room_types(room_types), address(address),
        traffic(traffic), food_types(food_types), business_hours(business_hours), has_performance(has_performance),
        avg_price(avg_price), owner(owner), owner_id(owner_id), notes(notes) {}

    // 获取ID
    string getId() const {
        return id;
    }

    // 获取名称
    string getName() const {
        return name;
    }

    // 获取开业时间
    string getOpeningTime() const {
        return opening_time;
    }

    // 获取包间种类
    string getRoomTypes() const {
        return room_types;
    }

    // 获取地址
    string getAddress() const {
        return address;
    }

    // 获取交通情况
    string getTraffic() const {
        return traffic;
    }

    // 获取餐饮种类
    string getFoodTypes() const {
        return food_types;
    }

    // 获取营业时间
    string getBusinessHours() const {
        return business_hours;
    }

    // 是否有演艺表演
    int hasPerformance() const {
        return has_performance;
    }

    // 获取平均消费价位
    float getAvgPrice() const {
        return avg_price;
    }

    // 获取餐厅法人
    string getOwner() const {
        return owner;
    }

    // 获取餐厅法人身份证号
    string getOwnerId() const {
        return owner_id;
    }

    // 获取备注
    string getNotes() const {
        return notes;
    }

    // 打印信息
    void printInfo() const {
        cout << "餐厅编号: " << id << endl;
        cout << "餐厅名称: " << name << endl;
        cout << "开业时间: " << opening_time << endl;
        cout << "包间种类: " << room_types << endl;
        cout << "详细地址: " << address << endl;
        cout << "交通情况: " << traffic << endl;
        cout << "餐饮种类: " << food_types << endl;
        cout << "营业时间: " << business_hours << endl;
        cout << "是否有演艺表演: " << (has_performance ? "有" : "无") << endl;
        cout << "平均消费价位: " << avg_price << endl;
        cout << "餐厅法人: " << owner << endl;
        cout << "餐厅法人身份证号: " << owner_id << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string name, string opening_time, string room_types, string address, string traffic,
        string food_types, string business_hours, int has_performance, float avg_price,
        string owner, string owner_id, string notes) {
        this->name = name;
        this->opening_time = opening_time;
        this->room_types = room_types;
        this->address = address;
        this->traffic = traffic;
        this->food_types = food_types;
        this->business_hours = business_hours;
        this->has_performance = has_performance;
        this->avg_price = avg_price;
        this->owner = owner;
        this->owner_id = owner_id;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(opening_time.c_str(), MAX_LEN);
        file.write(room_types.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(traffic.c_str(), MAX_LEN);
        file.write(food_types.c_str(), MAX_LEN);
        file.write(business_hours.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&has_performance), sizeof(has_performance));
        file.write(reinterpret_cast<const char*>(&avg_price), sizeof(avg_price));
        file.write(owner.c_str(), MAX_LEN);
        file.write(owner_id.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        opening_time = buffer;
        file.read(buffer, MAX_LEN);
        room_types = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        traffic = buffer;
        file.read(buffer, MAX_LEN);
        food_types = buffer;
        file.read(buffer, MAX_LEN);
        business_hours = buffer;
        file.read(reinterpret_cast<char*>(&has_performance), sizeof(has_performance));
        file.read(reinterpret_cast<char*>(&avg_price), sizeof(avg_price));
        file.read(buffer, MAX_LEN);
        owner = buffer;
        file.read(buffer, MAX_LEN);
        owner_id = buffer;
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class Restaurant2 {
private:
    string id;
    string name;
    string opening_time;
    string view_types;
    string address;
    string traffic;
    int people;
    string rec;
    string wait_hours;
    float ticket; 
    string warn;
    string notes;

public:
    // 构造函数
    Restaurant2(string id, string name, string opening_time, string view_types, string address, string traffic,
        string rec, string wait_hours,  float ticket,int people,
        string warn, string notes)
        : id(id), name(name), opening_time(opening_time), view_types(view_types), address(address),
        traffic(traffic), rec(rec), wait_hours(wait_hours), ticket(ticket),people(people),
         warn(warn), notes(notes) {}

    // 获取ID
    string getId() const {
        return id;
    }

    // 获取名称
    string getName() const {
        return name;
    }

    // 获取开业时间
    string getOpeningTime() const {
        return opening_time;
    }

    string getView_types() const {
        return view_types;
    }

    // 获取地址
    string getAddress() const {
        return address;
    }

    // 获取交通情况
    string getTraffic() const {
        return traffic;
    }
  
    string getRec() const {
        return rec;
    }
   
    string getWait_Hours() const {
        return wait_hours;
    }
   
    int getpeople() const {
        return people;
    }
   
    float getticket() const {
        return ticket;
    }
    
    string getWarn() const {
        return warn;
    }
    
    string getNotes() const {
        return notes;
    }
 
    void printInfo() const {
        cout << "景点编号: " << id << endl;
        cout << "景点名称: " << name << endl;       
        cout << "景点地址: " << address << endl;
        cout << "交通情况: " << traffic << endl;
        cout << "景点种类: " << view_types << endl;
        cout << "景点营业时间: " << opening_time << endl;
        cout << "景点容纳人数: " <<people<< endl;
        cout << "门票价格: " <<ticket<< endl;
        cout << "推荐度: " << rec << endl;
        cout << "平均等待时间: " << wait_hours<< endl;
        cout << "注意事项: " << warn << endl;
        cout << "备注: " << notes << endl;
    }

   
    void modifyInfo(string name, string opening_time, string view_types, string address, string traffic,
        string rec, string wait_hours, float ticket, int people,
        string warn, string notes)
    {
        this->name = name;
        this->opening_time = opening_time;
        this->view_types = view_types;
        this->address = address;
        this->traffic = traffic;
        this->rec = rec;
        this->wait_hours = wait_hours;  
        this->ticket = ticket;
        this->people = people;
        this->warn = warn;
        this->notes = notes;
    }
 
    bool compareId(const string& other_id) const {
        return id == other_id;
    }
 
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(opening_time.c_str(), MAX_LEN);
        file.write(view_types.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(traffic.c_str(), MAX_LEN);
        file.write(rec.c_str(), MAX_LEN);
        file.write(wait_hours.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&ticket), sizeof(ticket));
        file.write(reinterpret_cast<const char*>(&people), sizeof(people));
        file.write(warn.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }
   
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        opening_time = buffer;
        file.read(buffer, MAX_LEN);
        view_types = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        traffic = buffer;
        file.read(buffer, MAX_LEN);
        rec = buffer;
        file.read(buffer, MAX_LEN);
        wait_hours = buffer;
        file.read(reinterpret_cast<char*>(&ticket), sizeof(ticket));
        file.read(reinterpret_cast<char*>(&people), sizeof(people));
        file.read(buffer, MAX_LEN);
        warn= buffer;
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class Restaurant3 {
private:
    string id;
    string name;
    string racier;
    int people;
    string namelist;
    string master;
    int tel;
    string type;
    string list;
    string time;
    string address;
    string notes;

public:
    // 构造函数
    Restaurant3(string id, string name, string racier,
    int people,
    string namelist,
    string master,
    int tel,
    string type,
    string list,
    string time,
    string address,
    string notes)
        : id(id), name(name), racier(racier), people(people), namelist(namelist),
        master(master), tel(tel),type(type),list(list),time(time),address(address),notes(notes){}

    string getId() const {
        return id;
    }

    string getName() const {
        return name;
    }

    string getNamelist() const {
        return namelist;
    }

    string getRacier() const {
        return racier;
    }

    string getAddress() const {
        return address;
    }

    string getmaster() const {
        return master;
    }

    string getFoodType() const {
        return type;
    }

    string getTime() const {
        return time;
    }

    int people2() const {
        return people;
    }

    int gettel() const {
        return tel;
    }

    string getList() const {
        return list;
    }

    string getNotes() const {
        return notes;
    }

    // 打印信息
    void printInfo() const {
        cout << "团队编号: " << id << endl;
        cout << "团队名称: " << name << endl;
        cout << "团队民族: " << racier<< endl;
        cout << "团队人数: " << people << endl;
        cout << "团队成员名单: " << namelist << endl;
        cout << "负责人: " << master << endl;
        cout << "联系电话: " <<tel << endl;
        cout << "表演特色: " << type << endl;
        cout << "节目单: " << list << endl;
        cout << "时间: " << time << endl;
        cout << "地点: " << address << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string id, string name, string racier,
        int people,
        string namelist,
        string master,
        int tel,
        string type,
        string list,
        string time,
        string address,
        string notes) 
    {
        this->name = name;
        this->racier = racier;
        this->people = people;
        this->address = address;
        this->master = master;
        this->type = type;
        this->list = list;
        this->namelist = namelist;
        this->time =time;
        this->tel =tel;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(racier.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&people), sizeof(people));
        file.write(namelist.c_str(), MAX_LEN);
        file.write(master.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&tel), sizeof(tel));
        file.write(type.c_str(), MAX_LEN);
        file.write(list.c_str(), MAX_LEN);
        file.write(time.c_str(), MAX_LEN);       
        file.write(address.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        racier = buffer;
        file.read(reinterpret_cast<char*>(&people), sizeof(people));
        file.read(buffer, MAX_LEN);
        namelist = buffer;
        file.read(buffer, MAX_LEN);
        master = buffer;
        file.read(reinterpret_cast<char*>(&tel), sizeof(tel));
        file.read(buffer, MAX_LEN);
        type = buffer;
        file.read(buffer, MAX_LEN);
        list = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;               
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }

};

class Restaurant4 {
private:
    string id;
    string name;
    string owner_id;
    string sex;
    string birth;
    string town;
    string racier;
    string unit;
    string address;
    string culture;
    int tel;
    string body;
    string start;
    string end;
    string talent;
    string time;
    string notes;

public:
    // 构造函数
    Restaurant4(string id,
    string name,
    string owner_id,
    string sex,
    string birth,
    string town,
    string racier,
    string unit,
    string address,
    string culture,
    int tel,
    string body,
    string start,
    string end,
    string talent,
    string time,
    string notes)
        : id(id), name(name), owner_id(owner_id), sex(sex), birth(birth),town(town),racier(racier),
    unit(unit),address(address),culture(culture),tel(tel),body(body),start(start),end(end),talent(talent)
    ,time(time),notes(notes){}

    // 获取ID
    string getId() const {
        return id;
    }

    string getName() const {
        return name;
    }

    string getownerid() const {
        return owner_id;
    }

    string gettown() const
    {
        return town;
    }

    string getSex() const {
        return sex;
    }

    string getAddress() const {
        return address;
    }

    string getBirth() const {
        return birth;
    }

    string getCulture() const {
        return culture;
    }

    string getTime() const {
        return time;
    }

    string getEnd() const {
        return end;
    }

    int getTel() const {
        return tel;
    }

    string getRacier() const {
        return racier;
    }

    string getUnit() const {
        return unit;
    }

    string getBody() const {
        return body;
    }

    string getOwnerId() const {
        return owner_id;
    }

    string getTalent() const {
        return talent;
    }

    string getStart() const {
        return start;
    }

    string getNotes() const {
        return notes;
    }

    // 打印信息
    void printInfo() const {
        cout << "解说员编号: " << id << endl;
        cout << "解说员名称: " << name << endl;
        cout << "解说员身份证: " <<owner_id<< endl;
        cout << "性别: " << sex << endl;
        cout << "生日: " <<birth << endl;
        cout << "籍贯: " << town << endl;
        cout << "民族: " << racier << endl;
        cout << "单位: " << unit << endl;
        cout << "地址: " << address << endl;
        cout << "文化: " << culture << endl;
        cout << "电话: " << tel << endl;
        cout << "身体: " << body << endl;
        cout << "起始: " << start << endl;
        cout << "结束: " << end << endl;
        cout << "擅长: " << talent << endl;
        cout << "日期： " << time << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string id,
        string name,
        string owner_id,
        string sex,
        string birth,
        string town,
        string racier,
        string unit,
        string address,
        string culture,
        int tel,
        string body,
        string start,
        string end,
        string talent,
        string time,
        string notes) 
    {
        this->name = name;
        this->sex = sex;
        this->birth = birth;
        this->address = address;
        this->town = town;
        this->racier = racier;
        this->culture = culture;
        this->tel = tel;
        this->unit = unit;
        this->body = body;
        this->start =start;
        this->end = end;
        this->time=time;
        this->talent;
        this->owner_id = owner_id;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(owner_id.c_str(), MAX_LEN);
        file.write(sex.c_str(), MAX_LEN);
        file.write(birth.c_str(), MAX_LEN);
        file.write(town.c_str(), MAX_LEN);
        file.write(racier.c_str(), MAX_LEN);
        file.write(unit.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(culture.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&tel), sizeof(tel));
        file.write(body.c_str(), MAX_LEN);
        file.write(start.c_str(), MAX_LEN);
        file.write(end.c_str(), MAX_LEN);
        file.write(talent.c_str(), MAX_LEN);
        file.write(time.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        owner_id = buffer;
        file.read(buffer, MAX_LEN);
        sex = buffer;
        file.read(buffer, MAX_LEN);
        birth = buffer;
        file.read(buffer, MAX_LEN);
        town = buffer;
        file.read(buffer, MAX_LEN);
        racier = buffer;
        file.read(buffer, MAX_LEN);
        unit = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        culture=buffer;
        file.read(reinterpret_cast<char*>(&tel), sizeof(tel));
        file.read(buffer, MAX_LEN);
        body = buffer;
        file.read(buffer, MAX_LEN);
        start = buffer;
        file.read(buffer, MAX_LEN);
        end = buffer;
        file.read(buffer, MAX_LEN);
        talent = buffer;
        file.read(buffer, MAX_LEN);
        time = buffer;
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class Restaurant5 {
private:
    string id;
    string name;
    string star;
    string time;
    string type;
    string address;
    string traffic;
    string thing;
    string card;
    string view;
    string ol;
    string owner;
    string owner_id;
    string notes;

public:
    // 构造函数
    Restaurant5(string id,
    string name,
    string star,
    string time,
    string type,
    string address,
    string traffic,
    string thing,
    string card,
    string view,
    string ol,
    string owner,
    string owner_id,
    string notes)
        : id(id), name(name), star(star),time(time),type(type),address(address),traffic(traffic),
    thing(thing),card(card),view(view),ol(ol),owner(owner),owner_id(owner_id),notes(notes){}

    // 获取ID
    string getId() const {
        return id;
    }

    string getName() const {
        return name;
    }

    string getownerid() const {
        return owner_id;
    }

    string getStar() const {
        return star;
    }

    string getAddress() const {
        return address;
    }

    string getTraffic() const {
        return traffic;
    }

    string getThing() const {
        return thing;
    }

    string getTime() const {
        return time;
    }

    string getType() const {
        return type;
    }

    string getCard() const {
        return card;
    }

    string getOL() const {
        return ol;
    }

    string getOwner() const {
        return owner;
    }

    string getTrafficy() const {
        return traffic;
    }

    string getOwnerId() const {
        return owner_id;
    }

    string getView() const {
        return view;
    }

    string getNotes() const {
        return notes;
    }

    // 打印信息
    void printInfo() const {
        cout << "酒店编号: " << id << endl;
        cout << "酒店名称: " << name << endl;
        cout << "酒店星级: " << star << endl;
        cout << "开业时间: " << time << endl;
        cout << "客房种类: " << type << endl;
        cout << "地址: " << address<< endl;
        cout << "交通: " << traffic << endl;
        cout << "设施: " << thing << endl;
        cout << "支持卡类: " <<card << endl;
        cout << "景点: " << view << endl;
        cout << "上网(0免宽带，1不免宽带）: " <<ol << endl;
        cout << "法人: " << owner << endl;
        cout << "法人身份证: " << owner_id << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string id,
        string name,
        string star,
        string time,
        string type,
        string address,
        string traffic,
        string thing,
        string card,
        string view,
        string ol,
        string owner,
        string owner_id,
        string notes)
    {
        this->name = name;
        this->star = star;
        this->time = time;
        this->address = address;
        this->type = type;
        this->traffic = traffic;
        this->thing = thing;
        this->card = card;
        this->view =view;
        this->ol = ol;
        this->owner = owner;
        this->owner_id = owner_id;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(star.c_str(), MAX_LEN);
        file.write(time.c_str(), MAX_LEN);
        file.write(type.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(traffic.c_str(), MAX_LEN);
        file.write(thing.c_str(), MAX_LEN);
        file.write(card.c_str(), MAX_LEN);
        file.write(view.c_str(), MAX_LEN);
        file.write(ol.c_str(), MAX_LEN);
        file.write(owner.c_str(), MAX_LEN);
        file.write(owner_id.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        star = buffer;
        file.read(buffer, MAX_LEN);
        time = buffer;
        file.read(buffer, MAX_LEN);
        type = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        traffic = buffer;
        file.read(buffer, MAX_LEN);
        thing = buffer;
        file.read(buffer, MAX_LEN);
        card = buffer;
        file.read(buffer, MAX_LEN);
        view = buffer;
        file.read(buffer, MAX_LEN);
        ol = buffer;
        file.read(buffer, MAX_LEN);
        owner= buffer;
        file.read(buffer, MAX_LEN);
        owner_id = buffer;       
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class Restaurant6 {
private:
    string id;
    string name;
    string owner_id;
    string sex;
    string birth;
    string town;
    string racier;
    string unit;
    string address;
    string culture;
    int tel;
    string body;
    string high;
    string start;
    string end;
    string where;
    string time;
    string notes;

public:
    // 构造函数
    Restaurant6(string id,
    string name,
    string owner_id,
    string sex,
    string birth,
    string town,
    string racier,
    string unit,
    string address,
    string culture,
    int tel,
    string body,
    string high,
    string start,
    string end,
    string where,
    string time,
    string notes)
        : id(id), name(name), owner_id(owner_id), sex(sex), birth(birth), town(town), racier(racier),
        unit(unit), address(address), culture(culture), tel(tel), body(body), high(high), start(start), end(end), where(where)
        , time(time), notes(notes) {}

    // 获取ID
    string getId() const {
        return id;
    }

    string getName() const {
        return name;
    }

    string getownerid() const {
        return owner_id;
    }

    string getSex() const {
        return sex;
    }

    string getAddress() const {
        return address;
    }

    string gettown() const
    {
        return town;
    }

    string getBirth() const {
        return birth;
    }

    string getCulture() const {
        return culture;
    }

    string getTime() const {
        return time;
    }

    string hasEnd() const {
        return end;
    }

    string hasHigh() const {
        return high;
    }

    int getTel() const {
        return tel;
    }

    string getRacier() const {
        return racier;
    }

    string getUnit() const {
        return unit;
    }

    string getBody() const {
        return body;
    }

    string getOwnerId() const {
        return owner_id;
    }

    string getWhere() const {
        return where;
    }

    string getStart() const {
        return start;
    }

    string getNotes() const 
    {
        return notes;
    }

    // 打印信息
    void printInfo() const 
    {
        cout << "解说员编号: " << id << endl;
        cout << "解说员名称: " << name << endl;
        cout << "解说员身份证: " << owner_id << endl;
        cout << "性别: " << sex << endl;
        cout << "生日: " << birth << endl;
        cout << "籍贯: " << town << endl;
        cout << "民族: " << racier << endl;
        cout << "单位: " << unit << endl;
        cout << "地址: " << address << endl;
        cout << "文化: " << culture << endl;
        cout << "电话: " << tel << endl;
        cout << "身高: " << high << endl;
        cout << "身体: " << body << endl;
        cout << "起始: " << start << endl;
        cout << "结束: " << end << endl;
        cout << "地点: " << where << endl;
        cout << "日期： " << time << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string id,
        string name,
        string owner_id,
        string sex,
        string birth,
        string town,
        string racier,
        string unit,
        string address,
        string culture,
        int tel,
        string body,
        string high,
        string start,
        string end,
        string where,
        string time,
        string notes)
    {
        this->name = name;
        this->sex = sex;
        this->birth = birth;
        this->address = address;
        this->town = town;
        this->racier = racier;
        this->culture = culture;
        this->tel = tel;
        this->unit = unit;
        this->body = body;
        this->high = high;
        this->start = start;
        this->end = end;
        this->time=time;
        this->where=where;
        this->owner_id = owner_id;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(owner_id.c_str(), MAX_LEN);
        file.write(sex.c_str(), MAX_LEN);
        file.write(birth.c_str(), MAX_LEN);
        file.write(town.c_str(), MAX_LEN);
        file.write(racier.c_str(), MAX_LEN);
        file.write(unit.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(culture.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&tel), sizeof(tel));
        file.write(body.c_str(), MAX_LEN);
        file.write(high.c_str(), MAX_LEN);
        file.write(start.c_str(), MAX_LEN);
        file.write(end.c_str(), MAX_LEN);
        file.write(where.c_str(), MAX_LEN);
        file.write(time.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        owner_id = buffer;
        file.read(buffer, MAX_LEN);
        sex = buffer;
        file.read(buffer, MAX_LEN);
        birth = buffer;
        file.read(buffer, MAX_LEN);
        town = buffer;
        file.read(buffer, MAX_LEN);
        racier = buffer;
        file.read(buffer, MAX_LEN);
        unit = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        culture = buffer;
        file.read(reinterpret_cast<char*>(&tel), sizeof(tel));
        file.read(buffer, MAX_LEN);
        body = buffer;
        file.read(buffer, MAX_LEN);
        high = buffer;
        file.read(buffer, MAX_LEN);
        start = buffer;
        file.read(buffer, MAX_LEN);
        end = buffer;
        file.read(buffer, MAX_LEN);
        where= buffer;
        file.read(buffer, MAX_LEN);
        time = buffer;
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class Restaurant7 {
private:
    string id;
    string name;
    string owner_id;
    string sex;
    string birth;
    string town;
    string racier;
    string unit;
    string address;
    string culture;
    int tel;
    string body;
    string start;
    string end;
    string where;
    string time;
    string notes;

public:
    // 构造函数
    Restaurant7(string id,
        string name,
        string owner_id,
        string sex,
        string birth,
        string town,
        string racier,
        string unit,
        string address,
        string culture,
        int tel,
        string body,
        string start,
        string end,
        string where,
        string time,
        string notes)
        : id(id), name(name), owner_id(owner_id), sex(sex), birth(birth), town(town), racier(racier),
        unit(unit), address(address), culture(culture), tel(tel), body(body), start(start), end(end), where(where)
        , time(time), notes(notes) {}

    // 获取ID
    string getId() const {
        return id;
    }

    string getName() const {
        return name;
    }

    string getownerid() const {
        return owner_id;
    }

    string getSex() const {
        return sex;
    }

    string gettown() const
    {
        return town;
    }

    string getAddress() const {
        return address;
    }

    string getBirth() const {
        return birth;
    }

    string getCulture() const {
        return culture;
    }

    string getTime() const {
        return time;
    }

    string hasEnd() const {
        return end;
    }

    int getTel() const {
        return tel;
    }

    string getRacier() const {
        return racier;
    }

    string getUnit() const {
        return unit;
    }

    string getBody() const {
        return body;
    }

    string getOwnerId() const {
        return owner_id;
    }

    string getWhere() const {
        return where;
    }

    string getStart() const {
        return start;
    }

    string getNotes() const
    {
        return notes;
    }

    // 打印信息
    void printInfo() const
    {
        cout << "解说员编号: " << id << endl;
        cout << "解说员名称: " << name << endl;
        cout << "解说员身份证: " << owner_id << endl;
        cout << "性别: " << sex << endl;
        cout << "生日: " << birth << endl;
        cout << "籍贯: " << town << endl;
        cout << "民族: " << racier << endl;
        cout << "单位: " << unit << endl;
        cout << "地址: " << address << endl;
        cout << "文化: " << culture << endl;
        cout << "电话: " << tel << endl;
        cout << "身体: " << body << endl;
        cout << "起始: " << start << endl;
        cout << "结束: " << end << endl;
        cout << "地点: " << where << endl;
        cout << "日期： " << time << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string id,
        string name,
        string owner_id,
        string sex,
        string birth,
        string town,
        string racier,
        string unit,
        string address,
        string culture,
        int tel,
        string body,
        string start,
        string end,
        string where,
        string time,
        string notes)
    {
        this->name = name;
        this->sex = sex;
        this->birth = birth;
        this->address = address;
        this->town = town;
        this->racier = racier;
        this->culture = culture;
        this->tel = tel;
        this->unit = unit;
        this->body = body;
        this->start = start;
        this->end = end;
        this->time = time;
        this->where = where;
        this->owner_id = owner_id;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(owner_id.c_str(), MAX_LEN);
        file.write(sex.c_str(), MAX_LEN);
        file.write(birth.c_str(), MAX_LEN);
        file.write(town.c_str(), MAX_LEN);
        file.write(racier.c_str(), MAX_LEN);
        file.write(unit.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(culture.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&tel), sizeof(tel));
        file.write(body.c_str(), MAX_LEN);
        file.write(start.c_str(), MAX_LEN);
        file.write(end.c_str(), MAX_LEN);
        file.write(where.c_str(), MAX_LEN);
        file.write(time.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        owner_id = buffer;
        file.read(buffer, MAX_LEN);
        sex = buffer;
        file.read(buffer, MAX_LEN);
        birth = buffer;
        file.read(buffer, MAX_LEN);
        town = buffer;
        file.read(buffer, MAX_LEN);
        racier = buffer;
        file.read(buffer, MAX_LEN);
        unit = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        culture = buffer;
        file.read(reinterpret_cast<char*>(&tel), sizeof(tel));
        file.read(buffer, MAX_LEN);
        body = buffer;     
        file.read(buffer, MAX_LEN);
        start = buffer;
        file.read(buffer, MAX_LEN);
        end = buffer;
        file.read(buffer, MAX_LEN);
        where = buffer;
        file.read(buffer, MAX_LEN);
        time = buffer;
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class Restaurant8 {
private:
    string id;
    string name;
    string owner_id;
    string sex;
    string birth;
    string town;
    string racier;
    string unit;
    string address;
    string culture;
    int tel;
    string body;
    string bus;
    string start;
    string end;
    string where;
    string time;
    string notes;

public:
    // 构造函数
    Restaurant8(string id,
        string name,
        string owner_id,
        string sex,
        string birth,
        string town,
        string racier,
        string unit,
        string address,
        string culture,
        int tel,
        string body,
        string bus,
        string start,
        string end,
        string where,
        string time,
        string notes)
        : id(id), name(name), owner_id(owner_id), sex(sex), birth(birth), town(town), racier(racier),
        unit(unit), address(address), culture(culture), tel(tel), body(body),bus(bus), start(start), end(end), where(where)
        , time(time), notes(notes) {}

    // 获取ID
    string getId() const {
        return id;
    }

    string getName() const {
        return name;
    }

    string getownerid() const {
        return owner_id;
    }

    string gettown() const
    {
        return town;
    }

    string getSex() const {
        return sex;
    }

    string getAddress() const {
        return address;
    }

    string getBirth() const {
        return birth;
    }

    string getbus()const
    {
        return bus;
    }

    string getCulture() const {
        return culture;
    }

    string getTime() const {
        return time;
    }

    string hasEnd() const {
        return end;
    }

    int getTel() const {
        return tel;
    }

    string getRacier() const {
        return racier;
    }

    string getUnit() const {
        return unit;
    }

    string getBody() const {
        return body;
    }

    string getOwnerId() const {
        return owner_id;
    }

    string getWhere() const {
        return where;
    }

    string getStart() const {
        return start;
    }

    string getNotes() const
    {
        return notes;
    }

    // 打印信息
    void printInfo() const
    {
        cout << "解说员编号: " << id << endl;
        cout << "解说员名称: " << name << endl;
        cout << "解说员身份证: " << owner_id << endl;
        cout << "性别: " << sex << endl;
        cout << "生日: " << birth << endl;
        cout << "籍贯: " << town << endl;
        cout << "民族: " << racier << endl;
        cout << "单位: " << unit << endl;
        cout << "地址: " << address << endl;
        cout << "文化: " << culture << endl;
        cout << "电话: " << tel << endl;
        cout << "身体: " << body << endl;
        cout << "公交: " << bus << endl;
        cout << "起始: " << start << endl;
        cout << "结束: " << end << endl;
        cout << "地点: " << where << endl;
        cout << "日期： " << time << endl;
        cout << "备注: " << notes << endl;
    }

    // 修改信息
    void modifyInfo(string id,
        string name,
        string owner_id,
        string sex,
        string birth,
        string town,
        string racier,
        string unit,
        string address,
        string culture,
        int tel,
        string body,
        string bus,
        string start,
        string end,
        string where,
        string time,
        string notes)
    {
        this->name = name;
        this->sex = sex;
        this->birth = birth;
        this->address = address;
        this->town = town;
        this->racier = racier;
        this->culture = culture;
        this->tel = tel;
        this->unit = unit;
        this->body = body;
        this->bus = bus;
        this->start = start;
        this->end = end;
        this->time = time;
        this->where = where;
        this->owner_id = owner_id;
        this->notes = notes;
    }

    // 比较 ID
    bool compareId(const string& other_id) const {
        return id == other_id;
    }

    // 将对象写入文件
    void writeToFile(ofstream& file) const {
        file.write(id.c_str(), MAX_LEN);
        file.write(name.c_str(), MAX_LEN);
        file.write(owner_id.c_str(), MAX_LEN);
        file.write(sex.c_str(), MAX_LEN);
        file.write(birth.c_str(), MAX_LEN);
        file.write(town.c_str(), MAX_LEN);
        file.write(racier.c_str(), MAX_LEN);
        file.write(unit.c_str(), MAX_LEN);
        file.write(address.c_str(), MAX_LEN);
        file.write(culture.c_str(), MAX_LEN);
        file.write(reinterpret_cast<const char*>(&tel), sizeof(tel));
        file.write(body.c_str(), MAX_LEN);
        file.write(bus.c_str(), MAX_LEN);
        file.write(start.c_str(), MAX_LEN);
        file.write(end.c_str(), MAX_LEN);
        file.write(where.c_str(), MAX_LEN);
        file.write(time.c_str(), MAX_LEN);
        file.write(notes.c_str(), MAX_LEN);
    }

    // 从文件读取对象
    void readFromFile(ifstream& file) {
        char buffer[MAX_LEN];
        file.read(buffer, MAX_LEN);
        id = buffer;
        file.read(buffer, MAX_LEN);
        name = buffer;
        file.read(buffer, MAX_LEN);
        owner_id = buffer;
        file.read(buffer, MAX_LEN);
        sex = buffer;
        file.read(buffer, MAX_LEN);
        birth = buffer;
        file.read(buffer, MAX_LEN);
        town = buffer;
        file.read(buffer, MAX_LEN);
        racier = buffer;
        file.read(buffer, MAX_LEN);
        unit = buffer;
        file.read(buffer, MAX_LEN);
        address = buffer;
        file.read(buffer, MAX_LEN);
        culture = buffer;
        file.read(reinterpret_cast<char*>(&tel), sizeof(tel));
        file.read(buffer, MAX_LEN);
        body = buffer;
        file.read(buffer, MAX_LEN);
        bus= buffer;
        file.read(buffer, MAX_LEN);
        start = buffer;
        file.read(buffer, MAX_LEN);
        end = buffer;
        file.read(buffer, MAX_LEN);
        where = buffer;
        file.read(buffer, MAX_LEN);
        time = buffer;
        file.read(buffer, MAX_LEN);
        notes = buffer;
    }
};

class RestaurantManager {
private:
    vector<Restaurant> restaurants;

public:
    //遍历餐厅id
    bool isIdExisted(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    bool isOwnerIdExisted(string aid) {
        for (auto& arest : restaurants) {
            if (arest.getOwnerId()==aid)return true;
        }
        return false;//不是重复的
    }
    // 添加餐厅信息
    void addRestaurant(const Restaurant& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "餐厅编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改餐厅信息
    void modifyRestaurant(const string& id, const Restaurant& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getOpeningTime(),
                    updated_restaurant.getRoomTypes(), updated_restaurant.getAddress(), updated_restaurant.getTraffic(), 
                    updated_restaurant.getFoodTypes(), updated_restaurant.getBusinessHours(), updated_restaurant.hasPerformance(), 
                    updated_restaurant.getAvgPrice(), updated_restaurant.getOwner(), 
                    updated_restaurant.getOwnerId(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到餐厅，修改失败。" << endl;
    }

    // 删除餐厅信息
    void deleteRestaurant(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到餐厅，删除失败。" << endl;
        }
    }

    // 按特色统计餐厅信息
    void countByFeature(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getFoodTypes().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "特色为" << feature << "的餐厅数量: " << count << endl;
    }

    // 保存餐厅信息到文件
    void saveToFile(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) {
            Restaurant rest("", "", "", "", "", "", "", "", false, 0.0, "", "", "");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }
};

class RestaurantManager2 {
private:
    vector<Restaurant2> restaurants;
public:
    bool isIdExisted2(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }//基于范围的for循环
        return false;//不是重复的
    }
    //bool isOwnerIdExisted(string aid) {
    //    for (auto& arest : restaurants) {
    //        if (arest.getOwnerId() == aid)return true;
    //    }
    //    return false;//不是重复的
    //}
    void addRestaurant2(const Restaurant2& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    void modifyRestaurant2(const string& id, const Restaurant2& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getOpeningTime(), 
                    updated_restaurant.getView_types(), updated_restaurant.getAddress(), updated_restaurant.getTraffic(),
                    updated_restaurant.getRec(), updated_restaurant.getWait_Hours(),
                    updated_restaurant.getticket(), updated_restaurant.getpeople(),
                        updated_restaurant.getWarn(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    // 删除餐厅信息
    void deleteRestaurant2(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant2& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    // 按特色统计餐厅信息
    void countByFeature2(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getView_types().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "景点种类为" << feature << "的数量: " << count << endl;
    }

    // 保存餐厅信息到文件
    void saveToFile2(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile2(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) 
        {
            string st_data_trial = "";
            Restaurant2 rest("","","","","","","","",0,0,"","");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }
};

class RestaurantManager3 {
private:
    vector<Restaurant3> restaurants;

public:
    //遍历id
    bool isIdExisted3(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    //bool isOwnerIdExisted(string aid) {
    //    for (auto& arest : restaurants) {
    //        if (arest.getOwnerId() == aid)return true;
    //    }
    //    return false;//不是重复的
    //}
    void addRestaurant3(const Restaurant3& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改信息
    void modifyRestaurant3(const string& id, const Restaurant3& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getNamelist(),
                    updated_restaurant.getRacier(), updated_restaurant.people2(), 
                    updated_restaurant.getNamelist(),updated_restaurant.getmaster(),
                    updated_restaurant.gettel() , updated_restaurant.getFoodType() ,
                    updated_restaurant.getList(),updated_restaurant.getTime(),
                    updated_restaurant.getAddress(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    void deleteRestaurant3(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant3& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    void countByFeature3(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getFoodType().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "表演种类为" << feature << "的数量: " << count << endl;
    }

    void saveToFile3(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile3(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) 
        {
            string st_data_trial = "";
            Restaurant3 rest("", "", "", 0, "","", 0, "","", "", "", "");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
      
    }
   
};

class RestaurantManager4 {
private:
    vector<Restaurant4> restaurants;

public:
    //遍历餐厅id
    bool isIdExisted4(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    bool isOwnerIdExisted4(string aid) {
        for (auto& arest : restaurants) {
            if (arest.getOwnerId() == aid)return true;
        }
        return false;//不是重复的
    }
    // 添加餐厅信息
    void addRestaurant4(const Restaurant4& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改餐厅信息
    void modifyRestaurant4(const string& id, const Restaurant4& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getownerid(),
                    updated_restaurant.getSex(), updated_restaurant.getBirth(), updated_restaurant.gettown(),
                    updated_restaurant.getRacier(), updated_restaurant.getUnit(), updated_restaurant.getAddress(),
                    updated_restaurant.getCulture(), updated_restaurant.getBody(),
                    updated_restaurant.getTel(), updated_restaurant.getStart(),
                    updated_restaurant.getEnd(), updated_restaurant.getTalent(),
                    updated_restaurant.getTime(),
                    updated_restaurant.getOwnerId(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    void deleteRestaurant4(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant4& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    // 按特色统计信息
    void countByFeature4(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getCulture().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "文化为" << feature << "的数量: " << count << endl;
    }

    void saveToFile4(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile4(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) {
            Restaurant4 rest("","","","","","","","","","",0,"","","","","","");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }
};

class RestaurantManager5 {
private:
    vector<Restaurant5> restaurants;

public:
    //遍历餐厅id
    bool isIdExisted5(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    bool isOwnerIdExisted5(string aid) {
        for (auto& arest : restaurants) {
            if (arest.getOwnerId() == aid)return true;
        }
        return false;//不是重复的
    }
    // 添加餐厅信息
    void addRestaurant5(const Restaurant5& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改餐厅信息
    void modifyRestaurant5(const string& id, const Restaurant5& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getName(),
                    updated_restaurant.getStar(), updated_restaurant.getTime(), updated_restaurant.getType(),
                    updated_restaurant.getAddress(), updated_restaurant.getTraffic(), updated_restaurant.getThing(),
                    updated_restaurant.getCard(), updated_restaurant.getView(),
                    updated_restaurant.getOL(), updated_restaurant.getOwner(),
                    updated_restaurant.getOwnerId(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    // 删除餐厅信息
    void deleteRestaurant5(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant5& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    // 按特色统计餐厅信息
    void countByFeature5(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getType().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "客房种类为" << feature << "的数量: " << count << endl;
    }

    // 保存餐厅信息到文件
    void saveToFile5(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile5(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) {
            Restaurant5 rest("","","","","","","","","","","","","","");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }
};

class RestaurantManager6 {
private:
    vector<Restaurant6> restaurants;

public:
    //遍历餐厅id
    bool isIdExisted6(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    bool isOwnerIdExisted6(string aid) {
        for (auto& arest : restaurants) {
            if (arest.getOwnerId() == aid)return true;
        }
        return false;//不是重复的
    }
    // 添加餐厅信息
    void addRestaurant6(const Restaurant6& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改餐厅信息
    void modifyRestaurant6(const string& id, const Restaurant6& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getownerid(),
                    updated_restaurant.getSex(), updated_restaurant.getBirth(), updated_restaurant.gettown(),
                    updated_restaurant.getRacier(), updated_restaurant.getUnit(), updated_restaurant.getAddress(),
                    updated_restaurant.getCulture(), updated_restaurant.getBody(),
                    updated_restaurant.getTel() , updated_restaurant.hasHigh(), updated_restaurant.getStart(),
                    updated_restaurant.hasEnd(), updated_restaurant.getWhere(),
                    updated_restaurant.getTime(),
                    updated_restaurant.getOwnerId(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    void deleteRestaurant6(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant6& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    // 按特色统计信息
    void countByFeature6(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getCulture().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "文化为" << feature << "的数量: " << count << endl;
    }

    void saveToFile6(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile6(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) {
            Restaurant6 rest("", "", "", "", "", "", "", "", "", "", 0, "", "", "", "", "", "","");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }
};

class RestaurantManager7 {
private:
    vector<Restaurant7> restaurants;

public:
    //遍历餐厅id
    bool isIdExisted7(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    bool isOwnerIdExisted7(string aid) {
        for (auto& arest : restaurants) {
            if (arest.getOwnerId() == aid)return true;
        }
        return false;//不是重复的
    }
    // 添加餐厅信息
    void addRestaurant7(const Restaurant7& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改餐厅信息
    void modifyRestaurant7(const string& id, const Restaurant7& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getownerid(),
                    updated_restaurant.getSex(), updated_restaurant.getBirth(), updated_restaurant.gettown(),
                    updated_restaurant.getRacier(), updated_restaurant.getUnit(), updated_restaurant.getAddress(),
                    updated_restaurant.getCulture(), updated_restaurant.getBody(),
                    updated_restaurant.getTel(), updated_restaurant.getStart(),
                    updated_restaurant.hasEnd(), updated_restaurant.getWhere(),
                    updated_restaurant.getTime(),
                    updated_restaurant.getOwnerId(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    void deleteRestaurant7(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant7& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    // 按特色统计信息
    void countByFeature7(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getCulture().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "文化为" << feature << "的数量: " << count << endl;
    }

    void saveToFile7(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile7(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) {
            Restaurant7 rest("", "", "", "", "", "", "", "", "", "", 0, "", "", "", "", "", "");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }

};

class RestaurantManager8 {
private:
    vector<Restaurant8> restaurants;

public:
    //遍历餐厅id
    bool isIdExisted8(string aid) {
        for (auto& arest : restaurants) {
            if (arest.compareId(aid))return true;
        }
        return false;//不是重复的
    }
    bool isOwnerIdExisted8(string aid) {
        for (auto& arest : restaurants) {
            if (arest.getOwnerId() == aid)return true;
        }
        return false;//不是重复的
    }
    // 添加餐厅信息
    void addRestaurant8(const Restaurant8& restaurant) {
        for (const auto& rest : restaurants) {
            if (rest.compareId(restaurant.getId())) {
                cout << "编号重复，添加失败。" << endl;
                return;
            }
        }
        restaurants.push_back(restaurant);
        cout << "添加成功。" << endl;
    }

    // 修改餐厅信息
    void modifyRestaurant8(const string& id, const Restaurant8& updated_restaurant) {
        for (auto& rest : restaurants) {
            if (rest.compareId(id)) {
                rest.modifyInfo(updated_restaurant.getName(), updated_restaurant.getownerid(),
                    updated_restaurant.getSex(), updated_restaurant.getBirth(), updated_restaurant.gettown(),
                    updated_restaurant.getRacier(), updated_restaurant.getUnit(), updated_restaurant.getAddress(),
                    updated_restaurant.getCulture(), updated_restaurant.getBody(),
                    updated_restaurant.getTel(), updated_restaurant.getbus(), updated_restaurant.getStart(),
                    updated_restaurant.hasEnd(), updated_restaurant.getWhere(),
                    updated_restaurant.getTime(),
                    updated_restaurant.getOwnerId(), updated_restaurant.getNotes());
                cout << "修改成功。" << endl;
                return;
            }
        }
        cout << "未找到，修改失败。" << endl;
    }

    void deleteRestaurant8(const string& id) {
        auto it = remove_if(restaurants.begin(), restaurants.end(), [&](const Restaurant8& rest) {
            return rest.compareId(id);
            });

        if (it != restaurants.end()) {
            restaurants.erase(it, restaurants.end());
            cout << "删除成功。" << endl;
        }
        else {
            cout << "未找到，删除失败。" << endl;
        }
    }

    // 按特色统计信息
    void countByFeature8(const string& feature) const {
        int count = 0;
        for (const auto& rest : restaurants) {
            if (rest.getCulture().find(feature) != string::npos) {
                count++;
            }
        }
        cout << "文化为" << feature << "的数量: " << count << endl;
    }

    void saveToFile8(const string& filename) const {
        ofstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size = restaurants.size();
        file.write(reinterpret_cast<const char*>(&size), sizeof(size));
        for (const auto& rest : restaurants) {
            rest.writeToFile(file);
        }
        file.close();
        cout << "保存成功。" << endl;
    }

    // 从文件读取餐厅信息
    void loadFromFile8(const string& filename) {
        ifstream file(filename, ios::binary);
        if (!file) {
            cout << "文件打开失败。" << endl;
            return;
        }
        size_t size;
        file.read(reinterpret_cast<char*>(&size), sizeof(size));
        restaurants.clear();
        for (size_t i = 0; i < size; ++i) {
            Restaurant8 rest("", "", "", "", "", "", "", "", "", "", 0, "", "", "", "", "", "","");
            rest.readFromFile(file);
            restaurants.push_back(rest);
        }
        file.close();
        cout << "读取成功。" << endl;
    }
};

int main()
{
    RestaurantManager manager;
    RestaurantManager2 manager2;
    RestaurantManager3 manager3;
    RestaurantManager4 manager4;
    RestaurantManager5 manager5;
    RestaurantManager6 manager6;
    RestaurantManager7 manager7;
    RestaurantManager8 manager8;

    while (1)
    {
        int a;
        show();
        cin >> a;
        switch (a)
        {
        case 1:
            int choice;
            while (1)
            {
                system("cls");
                show1();
                cin >> choice;

                string id, name, opening_time, room_types, address, traffic,
                    food_types, business_hours, owner, owner_id, notes;
                int has_performance;
                float avg_price;

                switch (choice) {
                case 1:
                    cout << "请输入餐厅编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager.isIdExisted(id) == false) 
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "请输入餐厅名称: ";
                    cin >> name;
                    cout << "请输入开业时间: ";
                    cin >> opening_time;
                    cout << "请输入包间种类: ";
                    cin >> room_types;
                    cout << "请输入详细地址: ";
                    cin >> address;
                    cout << "请输入交通情况: ";
                    cin >> traffic;
                    cout << "请输入餐饮种类: ";
                    cin >> food_types;
                    cout << "请输入营业时间: ";
                    cin >> business_hours;
                    cout << "是否有演艺表演 (0 无, 1 有): ";
                    while (1)
                    {
                        cin >> has_performance;
                        if (has_performance == 0)
                        {
                            break;
                        }
                        if (has_performance == 1)
                        {
                            break;
                        }
                        else
                        {
                            cout << "请输入0或1" << endl;
                        }
                    }
                    cout << "请输入平均消费价位: ";
                    cin >> avg_price;
                    cout << "请输入餐厅法人: ";
                    cin >> owner;
                    cout << "请输入餐厅法人身份证号: ";
                    while (1) 
                    {
                        cin >> owner_id;
                        if (manager.isOwnerIdExisted(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "请输入备注: ";
                    cin >> notes;                   
                    manager.addRestaurant(Restaurant(id, name, opening_time, room_types,
                        address, traffic, food_types, business_hours, has_performance, 
                        avg_price, owner, owner_id, notes));
                    system("pause");
                    break;
                case 2:                                  
                    cout << "请输入要修改的餐厅编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager.isIdExisted(id) == false) {
                            cout << "编号不存在，重新输入" << endl;
                        }
                        else
                        {
                            cout << "请输入新的餐厅名称: ";
                            cin >> name;
                            cout << "请输入新的开业时间: ";
                            cin >> opening_time;
                            cout << "请输入新的包间种类: ";
                            cin >> room_types;
                            cout << "请输入新的详细地址: ";
                            cin >> address;
                            cout << "请输入新的交通情况: ";
                            cin >> traffic;
                            cout << "请输入新的餐饮种类: ";
                            cin >> food_types;
                            cout << "请输入新的营业时间: ";
                            cin >> business_hours;
                            cout << "是否有新的演艺表演 (0 无, 1 有): ";
                            while (1)
                            {
                                cin >> has_performance;
                                if (has_performance == 0)
                                {
                                    break;
                                }
                                if (has_performance == 1)
                                {
                                    break;
                                }
                                else
                                {
                                    cout << "请输入0或1" << endl;
                                }
                            }
                            cout << "请输入新的平均消费价位: ";
                            cin >> avg_price;
                            cout << "请输入新的餐厅法人: ";
                            cin >> owner;
                            cout << "请输入新的餐厅法人身份证号: ";                         
                            while (1) {
                                cin >> owner_id;
                                if (manager.isOwnerIdExisted(owner_id) == false)
                                {
                                    break;
                                }
                                else
                                {
                                    cout << "重复，重新输入" << endl;
                                }
                            }
                            cout << "请输入新的备注: ";
                            cin >> notes;
                            manager.modifyRestaurant(id, Restaurant(id, name, opening_time, room_types, address, traffic, food_types, business_hours, has_performance, avg_price, owner, owner_id, notes));
                            system("pause");
                            break;
                        }
                  
                    }
                    break;
                case 3:
                    cout << "请输入要删除的餐厅编号: ";
                    cin >> id;
                    manager.deleteRestaurant(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的餐厅特色: ";
                    cin >> food_types;
                    manager.countByFeature(food_types);
                    system("pause");
                    break;
                case 5:
                    manager.saveToFile("restaurants.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager.loadFromFile("restaurants.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    system("pause");
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 2:
            int choice2;
            while (1)
            {
                system("cls");
                show2();
                cin >> choice2;
                string id;
                string name;
                string opening_time;
                string view_types;
                string address;
                string traffic;
                int people;
                string rec;
                string wait_hours;
                float ticket;
                string warn;
                string notes;
                switch (choice2)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager2.isIdExisted2(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "请输入名称: ";
                    cin >> name;
                    cout << "请输入地址: ";
                    cin >> opening_time;
                    cout << "请输入特色: ";
                    cin >> view_types;
                    cout << "请输入交通: ";
                    cin >> address;
                    cout << "请输入开放时间: ";
                    cin >> traffic;
                    cout << "请输入容纳人数: ";
                    cin >> people;
                    cout << "请输入价格: ";
                    cin >> ticket;
                    cout << "请输入推荐度: ";
                    cin >> rec;
                    cout << "请输入平均候时: ";
                    cin >> opening_time;
                    cout << "请输入注意: ";
                    cin >> warn;                                    
                    cout << "请输入备注: ";
                    cin >> notes;
                    manager2.addRestaurant2(Restaurant2( id, name,  opening_time, view_types, address,  traffic,
                         rec,  wait_hours, ticket, people,
                         warn,  notes));
                    system("pause");
                    break;
                case 2:
                    cout << "请输入要修改的编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager2.isIdExisted2(id) == false) {
                            cout << "编号不存在，重新输入" << endl;
                        }
                        else
                        {
                            cout << "请输入新名称: ";
                            cin >> name;
                            cout << "请输入新地址: ";
                            cin >> opening_time;
                            cout << "请输入新特色: ";
                            cin >> view_types;
                            cout << "请输入新交通: ";
                            cin >> address;
                            cout << "请输入新开放时间: ";
                            cin >> traffic;
                            cout << "请输入新容纳人数: ";
                            cin >> people;
                            cout << "请输入新价格: ";
                            cin >> ticket;
                            cout << "请输入新推荐度: ";
                            cin >> rec;
                            cout << "请输入新平均候时: ";
                            cin >> opening_time;
                            cout << "请输入新注意: ";
                            cin >> warn;
                            cout << "请输入新备注: ";
                            cin >> notes;
                            manager2.modifyRestaurant2(id, Restaurant2(id, name, opening_time, view_types, address, traffic,
                                rec, wait_hours, ticket, people,
                                warn, notes));
                            break;
                        }
                    }
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager2.deleteRestaurant2(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的特色: ";
                    cin >> view_types;
                    manager2.countByFeature2(view_types);
                    system("pause");
                    break;
                case 5:
                    manager2.saveToFile2("view.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager2.loadFromFile2("view.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 3:
            int choice3;
            while (1)
            {
                system("cls");
                show3();
                cin >> choice3;

                string id;
                string name;
                string racier;
                int people;
                string namelist;
                string master;
                int tel;
                string type;
                string list;
                string time;
                string address;
                string notes;
                switch (choice3)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager.isIdExisted(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "团队名称: " ;
                    cin >> name;
                    cout << "团队民族: " ;
                    cin>>racier;
                    cout << "团队人数: " ;
                    cin >> people;
                    cout << "团队成员名单: " ;
                       cin>> namelist ;
                    cout << "负责人: " ;
                       cin>> master ;
                    cout << "联系电话: " ;
                       cin>> tel ;
                    cout << "表演特色: ";
                        cin>>type ;
                    cout << "节目单: ";
                        cin>>list ;
                    cout << "时间: " ;
                       cin>> time ;
                    cout << "地点: " ;
                        cin>>address ;
                    cout << "备注: " ;
                        cin>>notes ;
                    manager3.addRestaurant3(Restaurant3( id, name,  racier,
                         people,
                        namelist,
                         master,
                         tel,
                         type,
                         list,
                         time,
                         address,
                         notes));
                    system("pause");
                    break;
                case 2:
                    cout << "请输入修改编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager.isIdExisted(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "团队名称: ";
                    cin >> name;
                    cout << "团队民族: ";
                    cin >> racier;
                    cout << "团队人数: ";
                    cin >> people;
                    cout << "团队成员名单: " ;
                    cin >> namelist;
                    cout << "负责人: " ;
                    cin >> master;
                    cout << "联系电话: ";
                    cin >> tel;
                    cout << "表演特色: " ;
                    cin >> type;
                    cout << "节目单: ";
                    cin >> list;
                    cout << "时间: " ;
                    cin >> time;
                    cout << "地点: " ;
                    cin >> address;
                    cout << "备注: " ;
                    cin >> notes;
                    manager3.modifyRestaurant3(id,Restaurant3(id, name, racier,
                        people,
                        namelist,
                        master,
                        tel,
                        type,
                        list,
                        time,
                        address,
                        notes));
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager3.deleteRestaurant3(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的特色: ";
                    cin >> type;
                    manager3.countByFeature3(type);
                    system("pause");
                    break;
                case 5:
                    manager3.saveToFile3("racier.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager3.loadFromFile3("racier.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 4:
            int choice4;
            while (1)
            {
                system("cls");
                show4();
                cin >> choice4;
                string id;
                string name;
                string owner_id;
                string sex;
                string birth;
                string town;
                string racier;
                string unit;
                string address;
                string culture;
                int tel;
                string body;
                string start;
                string end;
                string talent;
                string time;
                string notes;
                switch (choice4)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager4.isIdExisted4(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }         
                    cout << "解说员名称: "  ;
                    cin>> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager4.isOwnerIdExisted4(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                   
                    
                    cout << "性别: ";
                        cin>>sex;
                    cout << "生日: " ;
                    cin >> birth ;
                    cout << "籍贯: ";
                    cin >> town ;
                    cout << "民族: " ;
                    cin >> racier ;
                    cout << "单位: " ;
                    cin >> unit ; 
                    cout << "地址: " ;
                    cin >> address ;
                    cout << "文化: " ;
                    cin >> culture ;
                    cout << "电话: " ;
                    cin >> tel ;
                    cout << "身体: " ;
                    cin >> body ;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end ;
                    cout << "擅长: " ;
                    cin >> talent ;
                    cout << "日期： ";
                    cin >> time ;
                    cout << "备注: " ;
                    cin >> notes ;
                    
                    manager4.addRestaurant4(Restaurant4( id,
                    name,
                    owner_id,
                    sex,
                    birth,
                    town,
                    racier,
                    unit,
                    address,
                    culture,
                     tel,
                     body,
                     start,
                     end,
                     talent,
                     time,
                     notes));
                    system("pause");
                    break;
                case 2:
                    cout << "请输入修改编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager4.isIdExisted4(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "解说员名称: ";
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager4.isOwnerIdExisted4(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }


                    cout << "性别: " ;
                    cin >> sex;
                    cout << "生日: " ;
                    cin >> birth;
                    cout << "籍贯: " ;
                    cin >> town;
                    cout << "民族: " ;
                    cin >> racier;
                    cout << "单位: " ;
                    cin >> unit;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "文化: " ;
                    cin >> culture;
                    cout << "电话: " ;
                    cin >> tel;
                    cout << "身体: " ;
                    cin >> body;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end;
                    cout << "擅长: " ;
                    cin >> talent;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: " ;
                    cin >> notes;
                    manager4.modifyRestaurant4(id, Restaurant4(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,
                        start,
                        end,
                        talent,
                        time,
                        notes));
                    system("pause");
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager4.deleteRestaurant4(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的方面: ";
                    cin >> culture;
                    manager4.countByFeature4(culture);
                    system("pause");
                    break;
                case 5:
                    manager4.saveToFile4("narrator.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager4.loadFromFile4("narrator.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 5:
            int choice5;
            while (1)
            {
                system("cls");
                show5();
                cin >> choice5;
                string id;
                string name;
                string star;
                string time;
                string type;
                string address;
                string traffic;
                string thing;
                string card;
                string view;
                string ol;
                string owner;
                string owner_id;
                string notes;
                switch (choice5)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager5.isIdExisted5(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "名称: ";
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager5.isOwnerIdExisted5(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "酒店星级: " ;
                       cin>> star ;
                    cout << "开业时间: " ;
                        cin>>time;
                    cout << "客房种类: " ;
                        cin>>type ;
                    cout << "地址: " ;
                        cin>>address ;
                    cout << "交通: " ;
                        cin>>traffic;
                    cout << "设施: " ;
                        cin>>thing ;
                    cout << "支持卡类: " ;
                        cin>>card ;
                    cout << "景点: ";
                        cin>>view ;
                    cout << "上网(0免宽带，1不免宽带）: " ;
                    cin >> ol;
                    cout << "法人: ";
                        cin>> owner ;
                    cout << "备注: " ;
                        cin>>notes ;
                        manager5.addRestaurant5(Restaurant5( id,
                         name,
                         star,
                         time,
                         type,
                         address,
                         traffic,
                         thing,
                         card,
                         view,
                         ol,
                         owner,
                         owner_id,
                         notes));
                        system("pause");
                    break;
                case 2:
                    cout << "请输入修改编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager5.isIdExisted5(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "名称: " ;
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager5.isOwnerIdExisted5(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "酒店星级: " ;
                    cin >> star;
                    cout << "开业时间: " ;
                    cin >> time;
                    cout << "客房种类: " ;
                    cin >> type;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "交通: " ;
                    cin >> traffic;
                    cout << "设施: ";
                    cin >> thing;
                    cout << "支持卡类: " ;
                    cin >> card;
                    cout << "景点: " ;
                    cin >> view;
                    cout << "上网(0免宽带，1不免宽带）: " ;
                    cin >> ol;
                    cout << "法人: " ;
                    cin >> owner;
                    cout << "备注: " ;
                    cin >> notes;
                    manager5.modifyRestaurant5(id, Restaurant5(id,
                        name,
                        star,
                        time,
                        type,
                        address,
                        traffic,
                        thing,
                        card,
                        view,
                        ol,
                        owner,
                        owner_id,
                        notes));
                    system("pause");
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager5.deleteRestaurant5(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的方面: ";
                    cin >> type;
                    manager5.countByFeature5(type);
                    system("pause");
                    break;
                case 5:
                    manager5.saveToFile5("hotel.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager5.loadFromFile5("hotel.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 6:
            int choice6;
            while (1)
            {
                system("cls");
                show6();
                cin >> choice6;
                string id;
                string name;
                string owner_id;
                string sex;
                string birth;
                string town;
                string racier;
                string unit;
                string address;
                string culture;
                int tel;
                string body;
                string high;
                string start;
                string end;
                string where;
                string time;
                string notes;
                switch (choice6)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager6.isIdExisted6(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "解说员名称: " ;
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager6.isOwnerIdExisted6(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }


                    cout << "性别: " ;
                    cin >> sex;
                    cout << "生日: " ;
                    cin >> birth;
                    cout << "籍贯: " ;
                    cin >> town;
                    cout << "民族: " ;
                    cin >> racier;
                    cout << "单位: " ;
                    cin >> unit;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "文化: " ;
                    cin >> culture;
                    cout << "电话: " ;
                    cin >> tel;
                    cout << "身体: " ;
                    cin >> body;
                    cout << "身高: " ;
                    cin >> high;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end;
                    cout << "擅长: " ;
                    cin >> where;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: " ;
                    cin >> notes;

                    manager6.addRestaurant6(Restaurant6(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,
                        high,
                        start,
                        end,
                        where,
                        time,
                        notes));
                    system("pause");
                   
                    break;
                case 2:
                    cout << "请输入修改编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager6.isIdExisted6(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "解说员名称: " ;
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager6.isOwnerIdExisted6(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "性别: " ;
                    cin >> sex;
                    cout << "生日: " ;
                    cin >> birth;
                    cout << "籍贯: " ;
                    cin >> town;
                    cout << "民族: " ;
                    cin >> racier;
                    cout << "单位: " ;
                    cin >> unit;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "文化: " ;
                    cin >> culture;
                    cout << "电话: " ;
                    cin >> tel;
                    cout << "身体: " ;
                    cin >> body;
                    cout << "身高: " ;
                    cin >> high;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end;
                    cout << "擅长: " ;
                    cin >> where;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: " ;
                    cin >> notes;
                    manager6.modifyRestaurant6(id, Restaurant6(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,
                        high,
                        start,
                        end,
                       where,
                        time,
                        notes));
                    system("pause");
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager6.deleteRestaurant6(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的方面: ";
                    cin >> culture;
                    manager6.countByFeature6(culture);
                    system("pause");
                    break;
                case 5:
                    manager6.saveToFile6("station.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager6.loadFromFile6("station.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 7:
            int choice7;
            while (1)
            {
                system("cls");
                show7();
                cin >> choice7;
                string id;
                string name;
                string owner_id;
                string sex;
                string birth;
                string town;
                string racier;
                string unit;
                string address;
                string culture;
                int tel;
                string body;
                string start;
                string end;
                string where;
                string time;
                string notes;
                switch (choice7)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager7.isIdExisted7(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "名称: ";
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager7.isOwnerIdExisted7(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "性别: " ;
                    cin >> sex;
                    cout << "生日: " ;
                    cin >> birth;
                    cout << "籍贯: " ;
                    cin >> town;
                    cout << "民族: " ;
                    cin >> racier;
                    cout << "单位: " ;
                    cin >> unit;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "文化: " ;
                    cin >> culture;
                    cout << "电话: " ;
                    cin >> tel;
                    cout << "身体: " ;
                    cin >> body;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end;
                    cout << "擅长: " ;
                    cin >> where;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: " ;
                    cin >> notes;

                    manager7.addRestaurant7(Restaurant7(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,
                        start,
                        end,
                        where,
                        time,
                        notes));
                    system("pause");
                   
                    break;
                case 2:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager7.isIdExisted7(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "名称: " ;
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager7.isOwnerIdExisted7(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "性别: "  ;
                    cin >> sex;
                    cout << "生日: "  ;
                    cin >> birth;
                    cout << "籍贯: "  ;
                    cin >> town;
                    cout << "民族: "  ;
                    cin >> racier;
                    cout << "单位: "  ;
                    cin >> unit;
                    cout << "地址: "  ;
                    cin >> address;
                    cout << "文化: "  ;
                    cin >> culture;
                    cout << "电话: "  ;
                    cin >> tel;
                    cout << "身体: "  ;
                    cin >> body;
                    cout << "起始: "  ;
                    cin >> start;
                    cout << "结束: "  ;
                    cin >> end;
                    cout << "擅长: "  ;
                    cin >> where;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: "  ;
                    cin >> notes;
                    manager7.modifyRestaurant7(id, Restaurant7(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,                     
                        start,
                        end,
                        where,
                        time,
                        notes));
                    system("pause");
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager7.deleteRestaurant7(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的方面: ";
                    cin >> culture;
                    manager7.countByFeature7(culture);
                    system("pause");
                    break;
                case 5:
                    manager7.saveToFile7("safe.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager7.loadFromFile7("safe.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 8:
            int choice8;
            while (1)
            {
                system("cls");
                show8();
                cin >> choice8;
                string id;
                string name;
                string owner_id;
                string sex;
                string birth;
                string town;
                string racier;
                string unit;
                string address;
                string culture;
                int tel;
                string body;
                string bus;
                string start;
                string end;
                string where;
                string time;
                string notes;
                switch (choice8)
                {
                case 1:
                    cout << "请输入编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager8.isIdExisted8(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "名称: " ;
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager8.isOwnerIdExisted8(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "性别: " ;
                    cin >> sex;
                    cout << "生日: " ;
                    cin >> birth;
                    cout << "籍贯: " ;
                    cin >> town;
                    cout << "民族: " ;
                    cin >> racier;
                    cout << "单位: " ;
                    cin >> unit;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "文化: " ;
                    cin >> culture;
                    cout << "电话: " ;
                    cin >> tel;
                    cout << "身体: " ;
                    cin >> body;
                    cout << "车辆: " ;
                    cin >>bus;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end;
                    cout << "擅长: " ;
                    cin >> where;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: " ;
                    cin >> notes;

                    manager8.addRestaurant8(Restaurant8(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,
                        bus,
                        start,
                        end,
                        where,
                        time,
                        notes));
                    system("pause");
                    break;
                case 2:
                    cout << "请输入修改编号: ";
                    while (1)
                    {
                        cin >> id;
                        if (manager8.isIdExisted8(id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "编号重复，重新输入" << endl;
                        }
                    }
                    cout << "名称: ";
                    cin >> name;
                    cout << "请输入身份证号: ";
                    while (1)
                    {
                        cin >> owner_id;
                        if (manager8.isOwnerIdExisted8(owner_id) == false)
                        {
                            break;
                        }
                        else
                        {
                            cout << "重复，重新输入" << endl;
                        }
                    }
                    cout << "性别: " ;
                    cin >> sex;
                    cout << "生日: " ;
                    cin >> birth;
                    cout << "籍贯: " ;
                    cin >> town;
                    cout << "民族: " ;
                    cin >> racier;
                    cout << "单位: " ;
                    cin >> unit;
                    cout << "地址: " ;
                    cin >> address;
                    cout << "文化: " ;
                    cin >> culture;
                    cout << "电话: " ;
                    cin >> tel;
                    cout << "身体: " ;
                    cin >> body;
                    cout << "车辆: " ;
                    cin >> bus;
                    cout << "起始: " ;
                    cin >> start;
                    cout << "结束: " ;
                    cin >> end;
                    cout << "擅长: " ;
                    cin >> where;
                    cout << "日期： ";
                    cin >> time;
                    cout << "备注: " ;
                    cin >> notes;
                    manager8.modifyRestaurant8(id, Restaurant8(id,
                        name,
                        owner_id,
                        sex,
                        birth,
                        town,
                        racier,
                        unit,
                        address,
                        culture,
                        tel,
                        body,
                        bus,
                        start,
                        end,
                        where,
                        time,
                        notes));
                    system("pause");
                    break;
                case 3:
                    cout << "请输入要删除的编号: ";
                    cin >> id;
                    manager8.deleteRestaurant8(id);
                    system("pause");
                    break;
                case 4:
                    cout << "请输入要统计的方面: ";
                    cin >> culture;
                    manager8.countByFeature8(culture);
                    system("pause");
                    break;
                case 5:
                    manager8.saveToFile8("train.dat");
                    cout << "已二进制形式保存" << endl;
                    system("pause");
                    break;
                case 6:
                    manager8.loadFromFile8("train.dat");
                    cout << "已二进制形式读取" << endl;
                    system("pause");
                    break;
                case 0:
                    break;
                default:
                    cout << "无效选择，请重试。" << endl;
                    system("pause");
                    break;
                }
                system("cls");
                break;
            }
            break;
        case 0:  //0.退出
            cout << "欢迎下次使用！" << endl;
            system("pause");
            return 0;
            break;
        default:
            system("cls");
            break;
        }
    }
}
